//
//  THGoodModel.m
//  TreeHole
//
//  Created by apple on 2020/7/29.
//  Copyright © 2020 stoneobs. All rights reserved.
//

#import "THGoodModel.h"

@implementation THGoodModel
+ (NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{@"g_id":@"id"};
}
- (NSString *)price{
    if (STTools_UserManger.defult.stoneobs_fun_get_loginedUser.level.intValue == 3) {
        //返回企业价格
        return self.business_price;
    }
    if (STTools_UserManger.defult.stoneobs_fun_get_loginedUser.level.intValue == 2) {
        //返回小店价格
        return self.shop_price;
    }

    if (self.is_pt.intValue == 1) {
        return self.pt_price;
    }
    if (self.is_sr.intValue == 1) {
        return self.sr_price;
    }
    if (self.is_xql.intValue == 1) {
        return self.xql_price;
    }
    if (_price.floatValue <= 0 ) {
        return self.old_price;
    }
    return _price;
}
- (NSString *)is_pt{
    if (STTools_UserManger.defult.stoneobs_fun_get_loginedUser.level.intValue > 1) {
        return @"0";
    }
    return _is_pt;
}
- (NSString *)is_sr{
    if (STTools_UserManger.defult.stoneobs_fun_get_loginedUser.level.intValue > 1) {
        return @"0";
    }
    return _is_sr;
}
- (NSString *)is_xql{
    if (STTools_UserManger.defult.stoneobs_fun_get_loginedUser.level.intValue > 1) {
        return @"0";
    }
    return _is_xql;
}
@end
